package com.indusfo.spc;

import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySource;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.web.bind.annotation.CrossOrigin;

import javax.annotation.PostConstruct;
import java.util.TimeZone;

@SpringBootApplication
@MapperScan(basePackages = "com.indusfo.spc.**.mapper")
@CrossOrigin
@NacosPropertySource(dataId = "ieis-mes.yml",groupId="mes",autoRefreshed=true)
public class MesApplication  extends SpringBootServletInitializer {
	@PostConstruct
	void started(){
		TimeZone.setDefault(TimeZone.getTimeZone("GMT+8"));
	}
	public static void main(String[] args) {
		SpringApplication.run(MesApplication.class, args);
	}
	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
		return application.sources(MesApplication.class);
	}
}
